from selenium import selenium
import unittest
from Picka import *
SERVER_SETUP = ["localhost", 4444, "*firefox", "http://google.com/"]

class GoogleTest(unittest.TestCase):        
    def setUp(self):
        self.verificationErrors = []
        self.selenium = selenium(*SERVER_SETUP)
        self.selenium.start()
    
    def tearDown(self):
        self.selenium.stop()
    

    def test_google_input(self):
        """test_google_input"""
        n = Name()
        for x in range(11):
            self.selenium.open("/")
            random_string = n.picka_random_string(15)
            if self.selenium.is_element_present("q") == True:
                self.selenium.type("q", random_string)
                self.selenium.click("btnG")
                self.selenium.wait_for_page_to_load("30000")                    

if __name__ == "__main__":
    unittest.main()